<form id="info-form" method="post">
    <table>
        <input type="hidden" name="id" value="@if(!empty($info)) {{$info['id']}} @endif" />
        <tr>
            <td width="60" align="right">仓库名称:</td>
            <td><input type="text" name="name" class="wu-text" value="@if(!empty($info)){{$info['name']}}@endif" /></td>
        </tr>
        <tr>
            <td align="right">仓库所在地区:</td>
            <td>
                <div id="distpicker">
                    <select id="province" data-province="---- 选择省 ----" title="选择省"></select>
                    <select id="city" data-city="---- 选择市 ----" title="选择市"></select>
                    <select id="district" data-district="---- 选择区 ----" title="选择区"></select>
                </div>
            </td>
        </tr>
        <tr>
            <td align="right">仓库详细地区:</td>
            <td><input type="text" name="address" class="wu-text" value="@if(!empty($info)){{$info['address']}}@endif" /></td>
        </tr>
        <tr>
            <td align="right">联系人:</td>
            <td><input type="text" name="contact" class="wu-text" value="@if(!empty($info)){{$info['contact']}}@endif" /></td>
        </tr>
        <tr>
            <td align="right">联系方式:</td>
            <td><input type="text" name="contact_way" class="wu-text" value="@if(!empty($info)){{$info['contact_way']}}@endif" /></td>
        </tr>
    </table>
</form>
<script type="text/javascript" src="/js/distpicker.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#distpicker").distpicker({
            valueType: "code"
        });
        var province = $("#province");
        var city = $("#city");
        var district = $("#district");
        @if(empty($info['province_id']) || empty($info['city_id']) || empty($info['area_id']))
        province.trigger("change");
        city.trigger("change");
        district.trigger("change");
        @else
        province.val({{$info['province_id']}}).trigger("change");
        city.val({{$info['city_id']}}).trigger("change");
        district.val({{$info['area_id']}}).trigger("change");
        @endif
    });
</script>

